﻿using UnityEngine;
using System.Collections;

namespace IMIForUnity
{
    public struct ImiSkeleton
    {
        public enum Index
        {
            HIP_CENTER = 0,
            SPINE,                // = 1, //(HIP_CENTER + 1),
            SHOULDER_CENTER,      // = 2, //(SPINE + 1),
            HEAD,                 // = 3, //(SHOULDER_CENTER + 1),
            SHOULDER_LEFT,        // = 4, //(HEAD + 1),
            ELBOW_LEFT,           // = 5, //(IMI_SKELETON_POSITION_SHOULDER_LEFT + 1),
            WRIST_LEFT,           // = 6, //(IMI_SKELETON_POSITION_ELBOW_LEFT + 1),
            HAND_LEFT,            // = 7, //(IMI_SKELETON_POSITION_WRIST_LEFT + 1),
            SHOULDER_RIGHT,       // = 8, //(IMI_SKELETON_POSITION_HAND_LEFT + 1),
            ELBOW_RIGHT,          // = 9, //(IMI_SKELETON_POSITION_SHOULDER_RIGHT + 1),
            WRIST_RIGHT,          // = 10, //(IMI_SKELETON_POSITION_ELBOW_RIGHT + 1),
            HAND_RIGHT,           // = 11, //(IMI_SKELETON_POSITION_WRIST_RIGHT + 1),
            HIP_LEFT,             // = 12, //(IMI_SKELETON_POSITION_HAND_RIGHT + 1),
            KNEE_LEFT,            // = 13, //(IMI_SKELETON_POSITION_HIP_LEFT + 1),
            ANKLE_LEFT,           // = 14, //(IMI_SKELETON_POSITION_KNEE_LEFT + 1),
            FOOT_LEFT,            // = 15, //(IMI_SKELETON_POSITION_ANKLE_LEFT + 1),
            HIP_RIGHT,            // = 16, //(IMI_SKELETON_POSITION_FOOT_LEFT + 1),
            KNEE_RIGHT,           // = 17, //(IMI_SKELETON_POSITION_HIP_RIGHT + 1),
            ANKLE_RIGHT,          // = 18, //(IMI_SKELETON_POSITION_KNEE_RIGHT + 1),
            FOOT_RIGHT,           // = 19, //(IMI_SKELETON_POSITION_ANKLE_RIGHT + 1),
            COUNT                 // = 20  //(IMI_SKELETON_POSITION_FOOT_RIGHT + 1)		// 20
        }
        public Index id;
        public bool isTracked;
        public Vector3 position;
        public Vector3 speed;
        public ImiWrapper.ImiVector4 positionV4;
        public Quaternion orientation;
        public Matrix4x4 HierarchicalRotationMatrix;
    }

    public enum Limb
    {
        Left_Forearm = 0,
        Left_Forearm_Wrist,
        Left_Postbrachium,
        Right_Forearm,
        Right_Forearm_Wrist,
        Right_Postbrachium,
        Left_Calf,
        Left_Calf_Ankle,
        Left_Thigh,
        Right_Calf,
        Right_Calf_Ankle,
        Right_Thigh,
        Spine,
        Count
    }


    public enum ImiSkeletonPositionTrackingState
    {
        IMI_SKELETON_POSITION_NOT_TRACKED = 0,
        IMI_SKELETON_POSITION_INFERRED,         // = (IMI_SKELETON_POSITION_NOT_TRACKED + 1) ,
        IMI_SKELETON_POSITION_TRACKED           // = (IMI_SKELETON_POSITION_INFERRED + 1)
    }

    public enum ImiSkeletonTrackingState
    {

        //表示不能被跟踪
        IMI_SKELETON_NOT_TRACKED = 0,// The user is not selected and is not available for selection

        //现在没有被跟踪，但可以设置跟踪
        IMI_SKELETON_POSITION_ONLY,      // The user is not selected and is available for selection,

        //跟踪成功，并且在持续跟踪中
        IMI_SKELETON_TRACKED,            // The user is being tracked and the skeleton position is valid

        //设置了跟踪，但是骨架还没跟踪到
        IMI_SKELETON_TRACKING,           // The user have been selected but is not tracked yet

        //设置了跟踪，但是跟踪失败
        IMI_SKELETON_FAILED,              // The user is selected but failed to be tracked. 
        //IMI_SKELETON_NOT_TRACKED = 0,
        //IMI_SKELETON_POSITION_ONLY,     // = (IMI_SKELETON_NOT_TRACKED + 1),
        //IMI_SKELETON_TRACKED            // = (IMI_SKELETON_POSITION_ONLY + 1)

    }


}
